import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home/index'
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[{
      path: 'index',
      name: '/home/index',
      component: () => import('../views/index/Index.vue')
    },
    {
      path: 'vip',
      name: '/home/vip',
      component: () => import('../views/VIP/Vip.vue')
    },
    {
      path: 'my',
      name: '/home/my',
      component: () => import('../views/my/My.vue')
    },
  ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  },
  {
    path: '/video',
    name: 'video',
    component: () => import('../views/my/Video.vue')
  },
  {
    path: '/content',
    name: 'content',
    component: () => import('../views/my/Content.vue')
  },
  {
    path: '/history',
    name: 'history',
    component: () => import('../views/my/History.vue')
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/my/News.vue')
  },
  {
    path: '/settings',
    name: 'settings',
    component: () => import('../views/my/Settings.vue')
  },
  {
    path: '/yijian',
    name: 'yijian',
    component: () => import('../views/my/Yijian.vue')
  },
  {
    path: '/user/user',
    name: 'user',
    component: () => import('../views/my/user/User.vue')
  },
  {
    path: '/user/avatar',
    name: 'avatar',
    component: () => import('../views/my/user/Avatar.vue')
  },
  {
    path: '/user/username',
    name: 'username',
    component: () => import('../views/my/user/Username.vue')
  },
  {
    path: '/user/set',
    name: 'set',
    component: () => import('../views/my/user/Set.vue')
  },
  {
    path: '/user/birthday',
    name: 'birthday',
    component: () => import('../views/my/user/Birthday.vue')
  },
  {
    path: '/user/phone',
    name: 'phone',
    component: () => import('../views/my/user/Phone.vue')
  },
  {
    path: '/user/password',
    name: 'password',
    component: () => import('../views/my/user/Password.vue')
  },
  {
    path: '/my/login',
    name: 'login',
    component: () => import('../views/my/Login.vue')
  },
  {
    path: '/my/reguest',
    name: 'reguest',
    component: () => import('../views/my/Reguest.vue')
  },
  {
    path: '/my/phonelogin',
    name: 'phonelogin',
    component: () => import('../views/my/Phonelogin.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
